import { createHashRouter } from 'react-router'
import Home from '@renderer/pages/home'
import Agent from '@renderer/pages/agent'
import AgentInfo from '@renderer/pages/agent/info'
import NotFound from '@renderer/pages/error/NotFound'
import KnowledgeText from '@renderer/pages/knowledge/text'
import KnowledgeTable from '@renderer/pages/knowledge/table'
import ModelChat from '@renderer/pages/model/chat'
import ModelVector from '@renderer/pages/model/vector'
import PluginLocal from '@renderer/pages/plugin/local'
import PluginCloud from '@renderer/pages/plugin/cloud'
import Workflow from '@renderer/pages/workflow'
import Layout from '@renderer/components/layout'
const router: ReturnType<typeof createHashRouter> = createHashRouter([
  {
    Component: Layout,
    children: [
      {
        path: '/',
        Component: Home,
        handle: {
          title: 'Home'
        }
      },
      {
        path: '/agent',
        Component: Agent
      },
      {
        path: '/agent/:id',
        Component: AgentInfo
      },
      {
        path: '/knowledge/text',
        Component: KnowledgeText
      },
      {
        path: '/knowledge/table',
        Component: KnowledgeTable
      },
      {
        path: '/model/text',
        Component: ModelChat
      },
      {
        path: '/model/vector',
        Component: ModelVector
      },
      {
        path: '/plugin/local',
        Component: PluginLocal
      },
      {
        path: '/plugin/cloud',
        Component: PluginCloud
      },
      {
        path: '/workflow',
        Component: Workflow
      },
      {
        path: '*',
        Component: NotFound
      }
    ]
  }
])

export default router
